package com.example.wangyongdong.bearsqlitedemo.Interface;

import com.example.wangyongdong.bearsqlitedemo.entity.BrandEntity;
import com.example.wangyongdong.bearsqlitedemo.entity.CarDetailEntity;

import java.util.Map;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * Created by wangyongdong on 2017/4/27.
 */

public interface BearJson {

    String BEAR_URL = "http://www.xiaoxiongyouhao.com/";

    @GET("models/pinpai.json")
    Call<BrandEntity> getBrands();  // Call<> 尖括号里填 请求回来的数据类型(实体类)

    @GET("models/{index}/che_xi.json")
    Call<BrandEntity> getCarSeries(@Path("index") int index);

    // 假如page传入5, size传入2
    // http://www.xiaoxiongyouhao.com/xxx/sss?page=5&size=2
    @GET("{xxx}/sss")
    Call<BrandEntity> get(@Path("xxx") String xxx,
                          @Query("page") int page,
                          @Query("size") int size);

    Call<BrandEntity> get(@QueryMap Map<String, String> map);

    @GET("models/{indexBrand}/che_xing_{indexSeries}.json")
    Call<BrandEntity> getCarType(@Path("indexBrand") int brand,
                                 @Path("indexSeries") int series);

    @GET("models/spec.php")
    Call<CarDetailEntity> getCarDetail(@Query("cheXing") int type);

}
